home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Revolution - Das Atari CD Magazin 1997
/
Revolution - Das Atari CD Magazin 1.iso
/
software
/
anwendng
/
qed_397
/
sourcen
/
rsc.c
< prev
next >
Wrap
C/C++ Source or Header
|
1997-01-14
|
7KB
|
244 lines
#include "global.h"
#include "fontsel.h"
#include "obj.h"
#include "scroll.h"
#include "rsc.h"
/*
* exportierte Variablen
*/
OBJECT *menu;
OBJECT *desktop;
OBJECT *about;
OBJECT *about2;
OBJECT *printer;
OBJECT *textinfo;
OBJECT *diskinfo;
OBJECT *prjinfo;
OBJECT *blockinfo;
OBJECT *replace;
OBJECT *repask;
OBJECT *diskfind;
OBJECT *pos;
OBJECT *marken;
OBJECT *funktionstasten;
OBJECT *makrorep;
OBJECT *zeichentab;
OBJECT *umlautkonv;
OBJECT *clearup;
OBJECT *fontsel;
OBJECT *globalop;
OBJECT *localop;
OBJECT *muster;
OBJECT *musterchg;
OBJECT *autosave;
OBJECT *fehler;
OBJECT *seoptions;
OBJECT *aktion;
OBJECT *prjscan;
OBJECT *icons;
OBJECT *winicon;
OBJECT *fhilfe;
OBJECT *rphilfe;
OBJECT *dfhilfe;
OBJECT *popups;
OBJECT *strings;
UBYTE **alertmsg;
UBYTE **copy_str;
WORD icon_anzahl;
/****** DEFINES ************************************************************/
/****** TYPES **************************************************************/
/****** VARIABLES **********************************************************/
LOCAL OBBLK usr_block[1500];
LOCAL OBJECT *setup;
LOCAL BOOLEAN dial3D, rsc_init = FALSE;
LOCAL WORD xrsrc_handle, xrsrc_data[16];
/***************************************************************************/
/* Initialisieren des Moduls */
/***************************************************************************/
BOOLEAN init_resource (VOID)
{
PATH rsc_path = "qed.rsc";
WORD x, y, w, h, i;
WORD workout[57];
OBJECT *ptr;
Busy_mouse();
xrsrc_handle = open_vwork(workout);
init_xrsrc(xrsrc_handle, (GRECT *)&desk, sys_wchar, sys_hchar);
shel_find(rsc_path);
if (file_exist(rsc_path))
rsc_init = xrsrc_load(rsc_path, xrsrc_data);
if (!rsc_init)
{
UBYTE *p;
p = getenv("QED");
if (p != NULL)
{
strcpy(rsc_path, p);
if (make_normalpath(rsc_path, FALSE))
{
strcat(rsc_path, "qed.rsc");
if (file_exist(rsc_path))
rsc_init = xrsrc_load (rsc_path, xrsrc_data);
}
}
if (!rsc_init)
form_alert (1, "[3][Resource-File|qed.rsc??][ EXIT ]");
}
if (rsc_init)
{
xrsrc_gaddr (R_TREE, SETUP, &setup, xrsrc_data);
dial3D = get_select(setup, SETUP3D);
xrsrc_gaddr (R_FRSTR, SCREEN, &alertmsg, xrsrc_data);
xrsrc_gaddr (R_TREE, MENUTREE, &menu, xrsrc_data);
xrsrc_gaddr (R_TREE, ABOUT, &about, xrsrc_data);
xrsrc_gaddr (R_TREE, ABOUT2, &about2, xrsrc_data);
xrsrc_gaddr (R_TREE, REPLACE, &replace, xrsrc_data);
xrsrc_gaddr (R_TREE, REPASK, &repask, xrsrc_data);
xrsrc_gaddr (R_TREE, LOCALOP, &localop, xrsrc_data);
xrsrc_gaddr (R_TREE, GLOBALOP, &globalop, xrsrc_data);
xrsrc_gaddr (R_TREE, POS, &pos, xrsrc_data);
xrsrc_gaddr (R_TREE, PRINTER, &printer, xrsrc_data);
xrsrc_gaddr (R_TREE, TEXTINFO, &textinfo, xrsrc_data);
xrsrc_gaddr (R_TREE, DESKTOP, &desktop, xrsrc_data);
xrsrc_gaddr (R_TREE, FONT, &fontsel, xrsrc_data);
xrsrc_gaddr (R_TREE, AKTION, &aktion, xrsrc_data);
xrsrc_gaddr (R_TREE, FUNKTION, &funktionstasten, xrsrc_data);
xrsrc_gaddr (R_TREE, DISKFIND, &diskfind, xrsrc_data);
xrsrc_gaddr (R_TREE, ICONS, &icons, xrsrc_data);
xrsrc_gaddr (R_TREE, WINICON, &winicon, xrsrc_data);
xrsrc_gaddr (R_TREE, FHILFE, &fhilfe, xrsrc_data);
xrsrc_gaddr (R_TREE, CLEARUP, &clearup, xrsrc_data);
xrsrc_gaddr (R_TREE, PRJINFO, &prjinfo, xrsrc_data);
xrsrc_gaddr (R_TREE, PRJSCAN, &prjscan, xrsrc_data);
xrsrc_gaddr (R_TREE, RPHILFE, &rphilfe, xrsrc_data);
xrsrc_gaddr (R_TREE, DISKINFOS, &diskinfo, xrsrc_data);
xrsrc_gaddr (R_TREE, MARKEN, &marken, xrsrc_data);
xrsrc_gaddr (R_TREE, DFHILFE, &dfhilfe, xrsrc_data);
xrsrc_gaddr (R_TREE, POPUPS, &popups, xrsrc_data);
xrsrc_gaddr (R_TREE, MUSTER, &muster, xrsrc_data);
xrsrc_gaddr (R_TREE, MUSTERCH, &musterchg, xrsrc_data);
xrsrc_gaddr (R_TREE, MAKROREP, &makrorep, xrsrc_data);
xrsrc_gaddr (R_TREE, UMLAUTE, ¨autkonv, xrsrc_data);
xrsrc_gaddr (R_TREE, BLOCKINFO, &blockinfo, xrsrc_data);
xrsrc_gaddr (R_TREE, AUTOSAVE, &autosave, xrsrc_data);
xrsrc_gaddr (R_TREE, FEHLER, &fehler, xrsrc_data);
xrsrc_gaddr (R_TREE, SEOPTION, &seoptions, xrsrc_data);
xrsrc_gaddr (R_TREE, STRINGS, &strings, xrsrc_data);
nkc_init(NKI_NO200HZ, 0, 0);
dial_init(Malloc, Mfree, NULL, NULL, NULL, dial3D, usr_block, 1500);
dial_fix (menu);
dial_fix (about);
dial_fix (about2);
dial_fix (replace);
dial_fix (repask);
dial_fix (globalop);
dial_fix (localop);
dial_fix (pos);
dial_fix (printer);
dial_fix (textinfo);
dial_fix (desktop);
dial_fix (fontsel);
dial_fix (aktion);
dial_fix (funktionstasten);
dial_fix (diskfind);
dial_fix (fhilfe);
dial_fix (clearup);
dial_fix (prjinfo);
dial_fix (prjscan);
dial_fix (rphilfe);
dial_fix (diskinfo);
dial_fix (marken);
dial_fix (dfhilfe);
dial_fix (popups);
dial_fix (muster);
dial_fix (musterchg);
dial_fix (makrorep);
dial_fix (umlautkonv);
dial_fix (blockinfo);
dial_fix (fehler);
dial_fix (icons);
dial_fix (winicon);
dial_fix (seoptions);
dial_fix (autosave);
/* Titel der Zeichenauswahl eintragen */
ascii_head(STRING(ZEICHSTR));
desktop->ob_x = 0;
desktop->ob_y = 0;
if (desk.x+desk.w > desktop->ob_width) /* Falls Desktop breiter Objektbreite */
desktop->ob_width = desk.x+desk.w; /* Große Bildschirme */
if (desk.y+desk.h > desktop->ob_height) /* Falls Desktop höher Objekthöhe */
desktop->ob_height = desk.y+desk.h; /* Große Bildschirme */
desktop[FKEYS].ob_y = desk.y+desk.h-desktop[FKEYS].ob_height-5;
desktop[FKEYS].ob_x = (desk.w-desktop[FKEYS].ob_width)>>1;
icon_anzahl = 0;
w = (icons[IDISK].ob_width+7)&(~7);
h = icons[IDISK].ob_height;
x = 0;
y = h;
/* Icons auf dem Desktop zählen, positionieren und verstecken */
for (i = FIRSTICON; i <= LASTICON; i++)
{
if (icon_anzahl == MAX_ICON_ANZ)
{
inote(1, FATALERR, 3);
break;
}
icon_anzahl++;
ptr = desktop + i;
ptr->ob_flags |= HIDETREE;
ptr->ob_x = x;
ptr->ob_y = y;
x += w;
if (x + w >= desktop->ob_width)
{
x = 0;
y += h;
}
}
}
Last_mouse();
return rsc_init;
} /* init_resource */
/*****************************************************************************/
/* Terminieren des Moduls */
/*****************************************************************************/
VOID term_resource (VOID)
{
if (rsc_init)
{
xrsrc_free(xrsrc_data);
term_xrsrc();
v_clsvwk(xrsrc_handle);
dial_exit();
nkc_exit();
}
} /* term_resource */